package org.link.dao;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.link.bean.User;
import org.link.mapper.UserMapper;
import org.springframework.stereotype.Repository;

@Repository
public class UserDao implements UserMapper {

	@Resource
	private SqlSessionFactory sqlSessionFactory;
	
	public Integer addUser(User user) {
		return null;
	}
	
	/**
	 * 
	 * description:添加用户并返回
	 * 2015年12月8日 下午4:10:41
	 * @author Link
	 * @param user
	 * @return
	 *
	 */
	public User addUsers(User user){
		SqlSession session = sqlSessionFactory.openSession(true);
		UserMapper userMapper = session.getMapper(UserMapper.class);
		userMapper.addUser(user);
		session.close();
		return user;
	} 

}
